package com.example.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.FinalPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Mapper
public interface FileDao extends BaseMapper<FinalPage> {

    @Select("select f.date_dir_path, f.stu_id, f.file_name, s.name, s.college, s.classroom, r.final_result\n" +
            "from file f , result r, student_information s\n" +
            "where f.stu_id = r. student_id and r.student_id = s.student_id\n" +
            "  and r.intermediate_result = '1'\n" +
            "limit #{current},#{size} ")
    List<FinalPage> getData(@Param("current") int current, @Param("size") int size);


}
